import dayjs from 'dayjs'
export const indexData = {
  columns: [
    { label: '供应商名称', prop: 'name' },
    { label: '地址', prop: 'address' },
    { label: '状态', prop: 'warn_status', slot: true  },
    { label: '联系人', prop: 'contacts' },
    { label: '电话', prop: 'mobile' },
    { label: '人员', prop: 'staff_num' },
  ],
  tableData: [],
  formList: [
    { label: '人员名称', placeholder: '人员名称', value: 'real_name', type: 'input' },
    // { label: '发证日期', placeholder: '请选择发证日期', value: 'end_time', type: 'date' },
    { label: '到期日期', placeholder: '请选择到期日期', value: 'valid_date', type: 'date' },
    // { label: '年龄', placeholder: '年龄', value: 'real_name', type: 'input' },
  ],
  formValue: {
    real_name: '',
    valid_date: '',
    // real_name: '',
  },
  tabsList: [
    { label: '全部', num: 0, name: 'all', key: 'allTotal' },
    { label: '临期', num: 0, name: '2', key: 'soon_expired_total' },
    { label: '过期', num: 0, name: '1', key: 'expired_total' },
    { label: '正常', num: 0, name: '0', key: 'normal_total' },
  ]
}

export const detectionData = {
  columns: [
    { label: '商品名称', prop: 'goods_name' },
    { label: '检测项目', prop: 'project_name' },
    { label: '合格率', prop: 'qualified_rate' },
    { label: '检测预警数量', prop: 'warn_total' },
    { label: '状态', prop: 'warn_status', slot: true },
  ],
  formList: [
    { label: '检测日期', placeholder: '请选择检测日期', value: 'real_time', type: 'daterange', clearable: false },
    { label: '商品名称', placeholder: '商品名称', value: 'goods_name', type: 'input' },
    { label: '状态', placeholder: '请选择状态', value: 'warn_status', type: 'select', options: [{ label: '正常', value: '0' }, { label: '预警', value: '1' }] },
    { label: '检测项目', placeholder: '请选择检测项目', value: 'project_id', type: 'select', options: [] },
  ],
  formValue: {
    real_time: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
    goods_name: '',
    warn_status: '',
    project_id: '',
  },
  tabsList: [
    { label: '全部', num: 0, name: 'all', key: 'total' },
    { label: '预警', num: 0, name: '1', key: 'warn_total' },
    { label: '正常', num: 0, name: '0', key: 'normal_total' },
  ]
}

export const detailData = {
  columns: [
    { label: '供应商名称', prop: 'company_name' },
    { label: '检测项目', prop: 'project_name' },
    { label: '抑制率', prop: 'inhibition_rate' },
    { label: '检测结果', prop: 'result', slot: true },
    { label: '检测员', prop: 'testing_user' },
  ],
  formList: [
    { label: '检测日期', placeholder: '请选择检测日期', value: 'real_time', type: 'daterange', clearable: false, disabled: true },
    { label: '商品名称', placeholder: '商品名称', value: 'goods_name', type: 'input', disabled: true },
    { label: '供应商', placeholder: '请选择供应商', value: 'company_id', type: 'select', options: [] },
    { label: '检测结果', placeholder: '请选择检测结果', value: 'result', type: 'select', options: [{ label: '合格', value: '1' }, { label: '不合格', value: '0' }] },
  ],
  formValue: {
    real_time: [],
    goods_name: '',
    result: '',
    company_id: ''
  },
}
